import server from "@/utils/request"
//获取角色列表
export function getrolelist(params) {
  return server({
    url: '/sys/role',
    method: 'get',
    params
  })
}
//添加角色
export function addrole(data) {
  return server({
    url: '/sys/role',
    method: 'post',
    data
  })
}
//修改角色
export function updatarole(data) {
  return server({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
// 删除角色
export function delrole(id) {
  return server({
    url: `/sys/role/${id}`,
    method: 'delete',
  })
}
//根据id获取详细的角色信息
export function getbyidrole(id) {
  return server({
    url: `/sys/role/${id}`,
    method: 'get',
  })
}
//给角色分配权限
export function putper(data) {
  return server({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}